home *** CD-ROM | disk | FTP | other *** search
/ TeX 1995 July / TeX CD-ROM July 1995 (Disc 1)(Walnut Creek)(1995).ISO / macros / latex209 / contrib / misc / eqnarray.sty < prev    next >
Text File  |  1993-01-11  |  4KB  |  100 lines

  1. %%% ====================================================================
  2. %%%  @LaTeX-style-file{
  3. %%%     author          = "David M. Jones",
  4. %%%     version         = "1.0",
  5. %%%     date            = "06 May 1992",
  6. %%%     time            = "16:30:57 EDT",
  7. %%%     filename        = "eqnarray.sty",
  8. %%%     address         = "MIT Laboratory for Computer Science
  9. %%%                        Room NE43-316
  10. %%%                        545 Technology Square
  11. %%%                        Cambridge, MA 02139
  12. %%%                        USA",
  13. %%%     telephone       = "(617) 253-5936",
  14. %%%     FAX             = "(617) 253-3480",
  15. %%%     checksum        = "36087 99 481 4448",
  16. %%%     email           = "dmjones@theory.lcs.mit.edu (Internet)",
  17. %%%     codetable       = "ISO/ASCII",
  18. %%%     keywords        = "LaTeX, eqnarray",
  19. %%%     supported       = "yes",
  20. %%%     docstring       = "This file reimplements the LaTeX eqnarray
  21. %%%                        environment to fix two problems: (1) the
  22. %%%                        standard definition places far too much
  23. %%%                        space around the second column (10 points
  24. %%%                        in the standard styles) and (2) the macro
  25. %%%                        \@eqnsel (see below) does not work as
  26. %%%                        documented in latex.tex.  If used in
  27. %%%                        conjunction with fleqn.sty, eqnarray must
  28. %%%                        appear after fleqn in the document-style
  29. %%%                        option list.
  30. %%%
  31. %%%                        I know of no bugs in this implementation,
  32. %%%                        but would be happy to hear of any problems
  33. %%%                        that arise with it.
  34. %%%
  35. %%%                        Oh, by the way, all of this would be
  36. %%%                        unnecessary if you used AMS-LaTeX.
  37. %%%
  38. %%%                        The checksum field above contains a CRC-16
  39. %%%                        checksum as the first value, followed by
  40. %%%                        the equivalent of the standard UNIX wc
  41. %%%                        (word count) utility output of lines,
  42. %%%                        words, and characters.  This is produced by
  43. %%%                        Robert Solovay's checksum utility.  This
  44. %%%                        program, as well as Nelson Beebe's proposal
  45. %%%                        for standard file headers, is available via
  46. %%%                        anonymous ftp from math.utah.edu.",
  47. %%%  }
  48. %%% ====================================================================
  49.  
  50. %% The default is for left-hand side of equations to be flushright.
  51. %% To make them flushleft, \let\@eqnsel = \relax
  52.  
  53. \let\@eqnsel\hfil
  54.  
  55. %% There are two main modifications.  First, I removed the
  56. %% \hskip\@centering from the beginning of the preamble.  This \hskip
  57. %% was, as far as I can tell, superfluous and was crippling \@eqnsel.
  58. %% Second, I removed the two occurences of \hskip 2\arraycolsep and
  59. %% change the template for the second column to ${{}##{}}$.  This
  60. %% restores the proper amount of space around the second column of the
  61. %% eqnarray.  I also introduced the parameters \@eqnmar and \@eqnhook
  62. %% to provide support for the flush left equation style.
  63.  
  64. \newskip\@eqnmar
  65. \@eqnmar\@centering
  66.  
  67. \let\@eqnhook\relax
  68.  
  69. \def\eqnarray{\stepcounter{equation}\let\@currentlabel=\theequation
  70. \global\@eqnswtrue
  71. \global\@eqcnt\z@\tabskip\@eqnmar\let\\=\@eqncr
  72. \@eqnhook
  73. $$\halign to \displaywidth\bgroup\@eqnsel
  74.   $\displaystyle\tabskip\z@{##}$&\global\@eqcnt\@ne
  75.   \hfil${{}##{}}$\hfil&\global\@eqcnt\tw@
  76.   $\displaystyle{##}$\hfil
  77.   \tabskip\@centering&\llap{##}\tabskip\z@\cr}
  78.  
  79. %% Since we've removed the \arraycolsep's from \eqnarray, we have to
  80. %% redefine \lefteqn to put that space back in.  It seems unlikely
  81. %% that \arraycolsep is really what should be used here, but the
  82. %% following definition maintains compatibility with the old
  83. %% definition of eqnarray.
  84.  
  85. \def\lefteqn#1{\hbox to 4\arraycolsep{$\displaystyle #1$\hss}}
  86.  
  87. %% Finally, if fleqn.sty has been invoked earlier, we set
  88. %% \@eqnmar=\mathindent and redefine \@eqnhook to futz around with
  89. %% \abovedisplayskip and friends.  Hopefully no-one else will define
  90. %% \mathindent.
  91.  
  92. \@ifundefined{mathindent}{}{\@eqnmar\mathindent
  93.     \def\@eqnhook{\abovedisplayskip\topsep
  94.     \ifvmode\advance\abovedisplayskip\partopsep\fi
  95.     \belowdisplayskip\abovedisplayskip
  96.     \belowdisplayshortskip\abovedisplayskip
  97.     \abovedisplayshortskip\abovedisplayskip}}
  98.  
  99. \endinput
  100.